package com.dingwen.pro.demo04;

import com.dingwen.pro.demo02.UserService;
import com.dingwen.pro.demo02.UserServiceImpl;

/**
 * 客户端
 *
 * @author dingwen
 * @date 2021/10/06
 */
public class Client {
    public static void main(String[] args) {
        // 真实角色
        UserServiceImpl userService = new UserServiceImpl();

        // 代理角色
        ProxyInvocationHandler proxyInvocationHandler = new ProxyInvocationHandler();
        proxyInvocationHandler.setTarget(userService);
        UserService userServiceProxy = (UserService) proxyInvocationHandler.getProxy();
        userServiceProxy.add();
    }
}
